<!--

    Copyright (c) 2015 Codenvy, S.A.
    All rights reserved. This program and the accompanying materials
    are made available under the terms of the Eclipse Public License v1.0
    which accompanies this distribution, and is available at
    http://www.eclipse.org/legal/epl-v10.html

    Contributors:
      Codenvy, S.A. - initial API and implementation

-->
<che-toolbar che-title="All Workspaces"
              che-add-button-name="New Workspace"
              che-add-button-href="#/create-workspace"
              che-search-placeholder="Search for workspaces..."
              che-search-model="listWorkspacesCtrl.workspaceFilter.config.name"
              che-event-logger="workspaces/new.workspace"></che-toolbar>
<md-content md-scroll-y flex layout="column" md-theme="maincontent-theme">
  <md-progress-linear md-mode="indeterminate" class="workspaces-list-progress"
                      ng-show="listWorkspacesCtrl.isInfoLoading"></md-progress-linear>
  <md-content flex class="workspace-list-content" ng-hide="listWorkspacesCtrl.isInfoLoading">
    <div ng-if="listWorkspacesCtrl.userWorkspaces.length === 0" layout="row" layout-align="center center" class="workspace-empty-list">
      <che-empty-state che-value="There are no workspaces yet."
                       che-icon-class="fa fa-server fa-lg icon"></che-empty-state>
    </div>
    <div ng-if="listWorkspacesCtrl.userWorkspaces.length > 0">
      <che-list-title che-icon="fa fa-folder" class="workspace-list-title">
        <span class="workspace-list-title">Workspaces ({{listWorkspacesCtrl.userWorkspaces.length}})</span>
        <span ng-show="listWorkspacesCtrl.userWorkspaces.length == 0" class="workspace-list-empty">- No workspaces inside</span>
        <span ng-show="(listWorkspacesCtrl.userWorkspaces | filter:listWorkspacesCtrl.workspaceFilter).length == 0 &&
              workspaces.length > 0" class="workspace-list-empty">- No workspaces found</span>
      </che-list-title>
      <che-list ng-show="(listWorkspacesCtrl.userWorkspaces | filter:listWorkspacesCtrl.workspaceFilter).length > 0">
        <che-workspace-item ng-repeat="workspace in listWorkspacesCtrl.userWorkspaces | filter:listWorkspacesCtrl.workspaceFilter"
                             che-workspace-item="workspace"></che-workspace-item>
      </che-list>
    </div>
  </md-content>
</md-content>

